package transport

import (
	"time"
	"context"
)

type TransportType int8


const (
	UNIX_SOCKET TransportType = iota+1
	TCP_SOCKET
)

type Options struct {
	Addr string
	Timeout time.Duration
	Context context.Context
	transportType TransportType
}


type Option func(*Options)
type DialOption func(*DialOptions)
type ListenOption func(*ListenOptions)


func Addr(addr string) Option{
	return func(options *Options) {
		options.Addr = addr
	}
}


func TransportTyp(typ TransportType) Option{
	return func(optioins *Options) {
		optioins.transportType = typ
	}
}

type DialOptions struct {
	Timeout time.Duration
	Context context.Context
}

type ListenOptions struct {
	Context context.Context
}

func Timeout(t time.Duration) Option {
	return func(o *Options) {
		o.Timeout = t
	}
}

func WithTimeout(d time.Duration) DialOption {
	return func(o *DialOptions) {
		o.Timeout = d
	}
}
